#ifndef GLSHADERCONFIG_H_
#define GLSHADERCONFIG_H_

#include <GL/glew.h>
#include <string>
#include <map>

typedef struct _bufferConfig {
	GLenum target;
	GLsizeiptr size;
	const GLvoid* data;
	GLenum usage;
} BufferConfig;

typedef struct _vertexAttrib {
	GLuint index;
	GLint size;
	GLenum type;
	GLboolean normalized;
	GLsizei stride;
	const GLvoid* pointer;
} VertexAttrib;

class GLShaderConfig {
private:
	std::string vertexShader;
	std::string fragmentShader;
	std::map<std::string, int> attributesIndex;
	std::map<std::string, VertexAttrib> attributesInfo;
	std::map<std::string, BufferConfig> attributesBuffer;
	int attributesCount;

public:
	static std::string VERTEX_POSITION_TAG;
	static std::string VERTEX_NORMAL_TAG;
	static std::string VERTEX_DIFFUSE_TEXTURE_COORD_TAG;
	static std::string VERTEX_DIRT_TEXTURE_COORD_TAG;

	GLShaderConfig();
	~GLShaderConfig();
	GLShaderConfig(std::string, std::string);
	GLShaderConfig(const GLShaderConfig &config);
	void setShaderFiles(std::string, std::string);
	void addVertexAttrib(GLuint index, std::string attribName);
	void addVertexAttribInfo(std::string attribName, VertexAttrib, BufferConfig);

	int getVertexAttribIndex(std::string attribName);
	VertexAttrib getVertexAttribInfo(std::string attribName);
	BufferConfig getVertexAttribBuffer(std::string attribBuffer);

	int getAttributesCount() { return attributesCount; };

	std::string getVertexShader() { return vertexShader; };
	std::string getFragmentShader() { return fragmentShader; };

	std::map<std::string, int> getAttributesIndex() { return attributesIndex; };
	std::map<std::string, VertexAttrib> getAttributesInfo() { return attributesInfo; };
	std::map<std::string, BufferConfig> getAttributesBuffer() { return attributesBuffer; };
};


#endif /* GLSHADERCONFIG_H_ */
